/**
 * 教师考勤模块API
 */

import axios from './request';

/**
 * 添加考勤审批流
 * @param {*} obj 
 * @returns 
 */
export const AddFlow = obj => axios.post('/attendance/add', obj);

/**
 * 修改考勤审批流
 * @param {*} obj 
 * @returns 
 */
export const UpdateFlow = obj => axios.put('/attendance/update', obj);

/**
 * 获取审批列表
 * @returns 
 */
export const GetList = () => axios.get('/attendance/list');

/**
 * 删除审批流
 * @param {*} type 
 * @returns 
 */
export const DeleteFlow = type => axios.delete('/attendance/delete/' + type);

/**
 * 申请考勤
 */
export const ApplyAttendance = obj => axios.post('/attendance/apply', obj);

/**
 * 搜索我的考勤列表
 * @param {*} obj 
 * @returns 
 */
export const SearchMyAttendances = obj => axios.get('/attendance/search', { params: obj });


/**
 * 获取需要我审批的考勤
 * @param {*} obj 
 * @returns 
 */
export const SearchAuditAttendances = () => axios.get('/attendance/applies');

/**
 * 获取审批流
 * @param {*} id 
 * @returns 
 */
export const GetAuditFlow = id => axios.get('/attendance/flows/' + id);

/**
 * 获取我的审批流
 * @param {*} id 
 * @returns 
 */
export const GetMyAuditFlow = id => axios.get('/attendance/myFlows/' + id);

/**
 * 审批
 * @param {*} obj 
 * @returns 
 */
export const Audit = obj => axios.put('/attendance/audit', obj);

/**
 * 更新我的考勤
 * @param {*} obj 
 * @returns 
 */
export const UpdateMyFlow = obj => axios.put('/attendance/updateMyFlow', obj);